﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace iDMS.Models
{
    [MetadataType(typeof(DesignChange_Buddy))]
    public partial class DesignChange
    {
        public string IndentifierAndTitle
        {
            get
            {
                return Identifier+" - "+ Title;
            }
        }

        public bool isActive
        {
            get
            {
                if (PhaseID == 2)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    }

    public class DesignChange_Buddy
    {
        [DataType(DataType.Date)]
        [Display(Name = "Planned Release Date")]
        [Required(ErrorMessage = "Planned Release Date is required")]
        public DateTime PlannedReleaseDate { get; set; }

         [DataType(DataType.MultilineText)]
         [Required(ErrorMessage = "Description is required")]
        public String Description { get; set; }

        [Required(ErrorMessage = "Title is required")]
         public String Title { get; set; }

        [Display(Name = "Reason")]
        public int ReasonID { get; set; }

        [Display(Name = " Change Builder")]
        public int ChangeBuilderEmployeeID { get; set; }

        [DataType(DataType.Date)]
        [Display(Name = "Created Date")]
        public DateTime CreateDate { get; set; }

        [Required(ErrorMessage = "Identifier is required")]
        public string Identifier { get; set; }
    }
}